<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<title>SMM·支付 管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/plugins.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/layout.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css"
	rel="stylesheet" type="text/css" id="style_color">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/custom.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css"
	href="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link
	href="${request.getContextPath()}/Public/assets/admin/css/common.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/kkpager.css"
	rel="stylesheet" type="text/css">
<link rel="shortcut icon"
	href="${request.getContextPath()}/Public/favicon.ico">
<link
	href="${request.getContextPath()}/Public/js/pandora/css/dialog.css"
	rel="stylesheet" type="text/css">
	<link href="${request.getContextPath()}/Public/css/loading.css"
	rel="stylesheet" type="text/css">
<script>
	BASE_URL = '${request.getContextPath()}'
</script>
<style type="text/css">
.table-condensed {
	width: 100%;
}

.datepicker-inline {
	width: 100%;
}

.col-md-4, .col-md-6, .col-md-7, .col-md-12 {
	padding-right: 0px;
	padding-left: 0px;
}

.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
	.table>thead>tr>td, .table>thead>tr>th {
	border-bottom: 1px solid #ddd;
}
</style>

</head>

<body class="page-header-top-fixed page-footer-fixed">

	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
	</div>

	<div class="clearfix"></div>
	<div class="page-container">
		<#include "/include/menu.html" />
		<!-- 首页内容开始 -->
		<div class="page-content-wrapper">
			<div class="page-content">
				<div class="container-fluid">
					<div class="col-md-12" style="margin-top: 50px;">
						<div class="row">
							<div class="col-md-12">
								<div class="portlet light">
									<div class="portlet-body">
										<div id="loading" style="display: none;" class="loading"
											align="center">
											<br /> <br /> <br /> <br /> <img class="loadingimg"
												src="${request.getContextPath()}/Public/images/loading.gif" />
										</div>
										<div style="margin-top: -4%;">
											<input type="hidden" id="dstatus" value="${dstatus}">
											<div class="col-sm-12">
												<div id="sample_2_filter" class="dataTables_filter">
													<label>交易编号： <input type="search"
														class="form-control input-medium  input-inline"
														id="tradeId" placeholder="交易编号" value="${(cash.tradeId)!}"
														aria-controls="sample_2">
													</label> &nbsp; <label>企业名称: <input type="search"
														class="form-control input-medium  input-inline"
														id="companyName" value="${(cash.companyName)!}"
														placeholder="企业名称" aria-controls="sample_2">
													</label> &nbsp; <label>出金日期:<input type="search"
														class="form-control input-small2 input-inline"
														value="${(cash.startTime)!}" placeholder="开始时间"
														name="startTime" id="startTime"
														onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"<#if
														startTime??>value="${startTime}"</#if> >
													</label> 至 <label><input type="search"
														class="form-control input-small2 input-inline"
														value="${(cash.endTime)!}" placeholder="结束时间"
														name="endTime" id="endTime"
														onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"<#if
														endTime??>value="${endTime}"</#if> > </label>
													<button class="btn red" type="button" onclick="selList();">
														<i class="fa fa-search"></i> 搜索
													</button>
												</div>
											</div>
										</div>
										<div style="margin-top: 5%;">
											<table class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>交易编号</th>
														<th>出金时间</th>
														<th>公司名称</th>
														<th>出金银行</th>
														<th>出金账号</th>
														<th>出金金额</th>
														<th>待出金金额</th>
														<th>账户可用余额</th>
														<th>出金状态</th>
														<th>审核状态</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody>
													<#list list as cash>
													<tr>
														<td>${(cash.cashNo)!}</td>
														<td>${(cash.applyTime)!}</td>
														<td>${(cash.userCompanyName)!}</td>
														<td>${(cash.cashBankName)!}</td>
														<td>${(cash.payChannelUserAccount)!}</td>
														<td>${(cash.cashMoney?string(',###.##'))!}</td>
														<td>${(cash.smmFreezeMoney?string(',###.##'))!}</td>
														<td>${(cash.userUseMoney?string(',###.##'))!}</td>
														<td><#if cash?? && cash?? && cash.applyStatus==0 >
															待出金 </#if> <#if cash?? && cash.applyStatus==1 > 已出金
															</#if> <#if cash?? && cash.applyStatus==2 > 出金失败 </#if>
															<#if cash?? && cash.applyStatus==3 > 已退回 </#if></td>
															
														<td><#if cash?? && cash?? && cash.replayStatus==0 >
															待审核 </#if> <#if cash?? && cash.replayStatus==1 >已通过
															</#if> <#if cash?? && cash.replayStatus==2 > 已关闭 </#if>
															</td>
																
														<td><#if cash ??&& cash.applyStatus==2 > <a
															href="javaScript:againCashApply(${(cash.id)!},${(cash.cashMoney)!})">出金</a>|<a
															href="javaScript:rerurnCashApply(${(cash.id)!},${(cash.cashMoney)!})">退回</a>
															</#if>
														</td>
													</tr>
													</#list>
												</tbody>
											</table>
										</div>
									</div>
									<div style="width: 80%; margin: 0 auto;">
										<div id="kkpager"></div>
										<input type="hidden" value="${totalPage}" id="totalPage">
										<input type="hidden" value="${totalRecords}" id="totalRecords">
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- END PAGE CONTENT -->
	</div>
	<!-- END PAGE CONTAINER -->
	<!-- 底部开始 -->

	<!-- 底部结束 -->

	<!--[if lt IE 9]>
<script src="${request.getContextPath()}/Public/assets/global/plugins/respond.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.sparkline.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker-index.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/highcharts.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js"
		type="text/javascript"></script>
	<script type="text/javascript"
		src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="${request.getContextPath()}/Public/js/pandora/pandora-dialog.js"></script>

	<script>
		jQuery(document).ready(function() {

			Metronic.init(); // init metronic core componets
			Layout.init(); // init layout
			//IndexComponent.init(); // init index component
			
// 			removeVal();
		});
		
		//初始化分页插件
		function getParameter(name) { 
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
			var r = window.location.search.substr(1).match(reg); 
			if (r!=null) return unescape(r[2]); return null;
		}
		//init
		$(function(){
// 			页面搜索条件
			var startTime= $('#startTime').val();
			var endTime= $('#endTime').val();
			var tradeId= $('#tradeId').val();
			var companyName= $('#companyName').val();
			var totalPage = $('#totalPage').val();
			var totalRecords = $('#totalRecords').val();
			var pageNo = getParameter('pno');
			if(!pageNo){
				pageNo = 1;
			}
			//生成分页
			//有些参数是可选的，比如lang，若不传有默认值
			kkpager.generPageHtml({
				pno : pageNo,
				//总页码
				total : totalPage,
				//总数据条数
				totalRecords : totalRecords,
				
				getLink : function(n){
					return this.hrefFormer + this.hrefLatter + "?pno="+n+"&startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus+"&tradeId="+tradeId+"&companyName="+encodeURI(encodeURI(companyName));
				}	
			});
		});
		

		//页面搜索区域返回结果数量
		function selList(){
			var startTime= $('#startTime').val();
			var endTime= $('#endTime').val();
			var tradeId= $('#tradeId').val();
			var companyName= $('#companyName').val();
			debugger;
			if(startTime=="" && endTime=="" && tradeId=="" && companyName=="" ){
				var url=BASE_URL+"/CashApply/queryCashApplyList.do?startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus+"&tradeId="+tradeId+"&companyName="+encodeURI(encodeURI(companyName));
				window.location =url;	
			}
			
			
			$.ajax({
				url : BASE_URL+"/CashApply/queryCashApplycount.do?startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus+"&tradeId="+tradeId+"&companyName="+encodeURI(encodeURI(companyName)),
				type : "post",
				dataType:'JSON',
				data:{},
				success : function(num) {
					debugger;
						if(num>20){
							CommonUtils.succModal2("系统提示","搜索结果过多,请更换搜索条件！");	
							return ;
						}else{					
							var url=BASE_URL+"/CashApply/queryCashApplyList.do?startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus+"&tradeId="+tradeId+"&companyName="+encodeURI(encodeURI(companyName));
							window.location =url;	
							
						}					
					}
				
			});
			
			
		}
		
		//退回
		function   rerurnCashApply(id,cashMoney){
			$.confirm("确认退回出金款项(￥"+cashMoney+")吗?", function () {
				document.getElementById("loading").style.display ="block";
				$.ajax({
					url : BASE_URL+"/CashApply/returnCashApply.do",
					type : "post",
					dataType:'JSON',
					data:{"id":id},
					success : function(result) {
						document.getElementById("loading").style.display ="none";
						var msg=result.msg;
						if (result.result == "ok") {
							CommonUtils.succModal2("系统提示",msg,"${request.getContextPath()}/CashApply/queryCashApplyList.do");
							
						
						}else{
							CommonUtils.succModal2("系统提示",msg);						
						}
					}
				});
			});
			}
		//重新出金
		function   againCashApply(id,cashMoney){
			$.confirm(" 确认出金后,系统将直接将款项打到实体用户上,确认出金(￥"+cashMoney+")吗?", function () {
				document.getElementById("loading").style.display ="block";
				$.ajax({
					url : BASE_URL+"/CashApply/againCashApply.do",
					type : "post",
					dataType:'JSON',
					data:{"id":id},
					success : function(result) {
						document.getElementById("loading").style.display ="none";
						var msg=result.msg;
						if (result.result == "ok") {
							CommonUtils.succModal2("系统提示",msg,"${request.getContextPath()}/CashApply/queryCashApplyList.do");
							
						
						}else{
							CommonUtils.succModal2("系统提示",msg);						
						}
					}
				});
			});
			}
		
		
	</script>
</body>
</html>